#include "gui/basedialog.h"
#include "gui/separatorwidget.h"
#include "core/constants.h"

void BaseDialog::setMainText(QString text)
{
    this->headerLabel->setText(text);
}

void BaseDialog::setSubText(QString text)
{
    this->subHeaderLabel->setText(text);
}

void BaseDialog::initDialogComponents()
{
    QFont font;
    mainLayout = new QVBoxLayout;

    headerLabel = new QLabel;
    font = headerLabel->font();
    font.setPointSize(font.pointSize() + HEADER_UPSIZE);
    headerLabel->setFont(font);
    mainLayout->addWidget(headerLabel);

    subHeaderLabel = new QLabel;
    mainLayout->addWidget(subHeaderLabel);
    mainLayout->addWidget(new SeparatorWidget);

    mainLayout->addStretch();
	this->setLayout(mainLayout);
}

BaseDialog::BaseDialog(QWidget *parent) :
    QDialog(parent)
{
    // Inheriting classes should be the ones to call initUiComponents()
}
